PageDomain

class PageDomain : Domain

Actions and events related to the inspected page belong to the page domain.

Functions

addCompilationCache
Link copied to clipboard
fun addCompilationCache(input: AddCompilationCacheRequest): Single<RequestResponseFrame>
Seeds compilation cache for given url.
addScriptToEvaluateOnLoad
Link copied to clipboard
Deprecated, please use addScriptToEvaluateOnNewDocument instead.
addScriptToEvaluateOnNewDocument
Link copied to clipboard
Evaluates given script in every frame upon creation (before loading frame's scripts).
bringToFront
Link copied to clipboard
fun bringToFront(): Single<RequestResponseFrame>
Brings page to front (activates tab).
captureScreenshot
Link copied to clipboard
fun captureScreenshot(input: CaptureScreenshotRequest): Single<CaptureScreenshotResponse>
Capture page screenshot.
captureSnapshot
Link copied to clipboard
fun captureSnapshot(input: CaptureSnapshotRequest): Single<CaptureSnapshotResponse>
Returns a snapshot of the page as a string.
clearCompilationCache
Link copied to clipboard
fun clearCompilationCache(): Single<RequestResponseFrame>
Clears seeded compilation cache.
clearDeviceMetricsOverride
Link copied to clipboard
fun clearDeviceMetricsOverride(): Single<RequestResponseFrame>
Clears the overriden device metrics.
clearDeviceOrientationOverride
Link copied to clipboard
fun clearDeviceOrientationOverride(): Single<RequestResponseFrame>
Clears the overridden Device Orientation.
clearGeolocationOverride
Link copied to clipboard
fun clearGeolocationOverride(): Single<RequestResponseFrame>
Clears the overriden Geolocation Position and Error.
close
Link copied to clipboard
fun close(): Single<RequestResponseFrame>
Tries to close page, running its beforeunload hooks, if any.
compilationCacheProduced
Link copied to clipboard
fun compilationCacheProduced(): Flowable<CompilationCacheProducedEvent>
Issued for every compilation cache generated.
crash
Link copied to clipboard
fun crash(): Single<RequestResponseFrame>
Crashes renderer on the IO thread, generates minidumps.
createIsolatedWorld
Link copied to clipboard
fun createIsolatedWorld(input: CreateIsolatedWorldRequest): Single<CreateIsolatedWorldResponse>
Creates an isolated world for the given frame.
deleteCookie
Link copied to clipboard
fun deleteCookie(input: DeleteCookieRequest): Single<RequestResponseFrame>
Deletes browser cookie with given name, domain and path.
description
Link copied to clipboard
fun description(): String
Returns domain description.
disable
Link copied to clipboard
fun disable(): Single<RequestResponseFrame>
Disables page domain notifications.
documentOpened
Link copied to clipboard
fun documentOpened(): Flowable<DocumentOpenedEvent>
Fired when opening document to write to.
domContentEventFired
Link copied to clipboard
fun domContentEventFired(): Flowable<DomContentEventFiredEvent>
Returns observable capturing all Page.domContentEventFired events.
downloadProgress
Link copied to clipboard
fun downloadProgress(): Flowable<DownloadProgressEvent>
Fired when download makes progress.
downloadWillBegin
Link copied to clipboard
fun downloadWillBegin(): Flowable<DownloadWillBeginEvent>
Fired when page is about to start a download.
enable
Link copied to clipboard
fun enable(): Single<RequestResponseFrame>
Enables page domain notifications.
events
Link copied to clipboard
fun events(): Flowable<Event>
Returns flowable capturing all domains events.
fun events(filter: Predicate<Event>): Flowable<Event>
Returns flowable capturing all domains events matching predicate.
fun <T : Event> events(eventClass: Class<T>): Flowable<T>
Returns flowable capturing all domain events of a given type.
fun <T : Event> events(eventClass: Class<T>, filter: Predicate<T>): Flowable<T>
Returns flowable capturing all domain events of a given type matching predicate.
fileChooserOpened
Link copied to clipboard
fun fileChooserOpened(): Flowable<FileChooserOpenedEvent>
Emitted only when page.interceptFileChooser is enabled.
frameAttached
Link copied to clipboard
fun frameAttached(): Flowable<FrameAttachedEvent>
Fired when frame has been attached to its parent.
frameClearedScheduledNavigation
Link copied to clipboard
fun frameClearedScheduledNavigation(): Flowable<FrameClearedScheduledNavigationEvent>
Fired when frame no longer has a scheduled navigation.
frameDetached
Link copied to clipboard
fun frameDetached(): Flowable<FrameDetachedEvent>
Fired when frame has been detached from its parent.
frameNavigated
Link copied to clipboard
fun frameNavigated(): Flowable<FrameNavigatedEvent>
Fired once navigation of the frame has completed.
frameRequestedNavigation
Link copied to clipboard
fun frameRequestedNavigation(): Flowable<FrameRequestedNavigationEvent>
Fired when a renderer-initiated navigation is requested.
frameResized
Link copied to clipboard
fun frameResized(): Flowable<RawEvent>
Returns observable capturing all Page.frameResized events.
frameScheduledNavigation
Link copied to clipboard
fun frameScheduledNavigation(): Flowable<FrameScheduledNavigationEvent>
Fired when frame schedules a potential navigation.
frameStartedLoading
Link copied to clipboard
fun frameStartedLoading(): Flowable<FrameStartedLoadingEvent>
Fired when frame has started loading.
frameStoppedLoading
Link copied to clipboard
fun frameStoppedLoading(): Flowable<FrameStoppedLoadingEvent>
Fired when frame has stopped loading.
generateTestReport
Link copied to clipboard
fun generateTestReport(input: GenerateTestReportRequest): Single<RequestResponseFrame>
Generates a report for testing.
getAppManifest
Link copied to clipboard
fun getAppManifest(): Single<GetAppManifestResponse>
getCookies
Link copied to clipboard
fun getCookies(): Single<GetCookiesResponse>
Returns all browser cookies.
getDependencies
Link copied to clipboard
open override fun getDependencies(): List<Domain>
Returns list of dependant domains that should be enabled prior to enabling this domain.
getFrameTree
Link copied to clipboard
fun getFrameTree(): Single<GetFrameTreeResponse>
Returns present frame tree structure.
getInstallabilityErrors
Link copied to clipboard
fun getInstallabilityErrors(): Single<GetInstallabilityErrorsResponse>
getLayoutMetrics
Link copied to clipboard
fun getLayoutMetrics(): Single<GetLayoutMetricsResponse>
Returns metrics relating to the layouting of the page, such as viewport bounds/scale.
getManifestIcons
Link copied to clipboard
fun getManifestIcons(): Single<GetManifestIconsResponse>
getNavigationHistory
Link copied to clipboard
fun getNavigationHistory(): Single<GetNavigationHistoryResponse>
Returns navigation history for the current page.
getPermissionsPolicyState
Link copied to clipboard
Get Permissions Policy state on given frame.
getResourceContent
Link copied to clipboard
fun getResourceContent(input: GetResourceContentRequest): Single<GetResourceContentResponse>
Returns content of the given resource.
getResourceTree
Link copied to clipboard
fun getResourceTree(): Single<GetResourceTreeResponse>
Returns present frame / resource tree structure.
handleJavaScriptDialog
Link copied to clipboard
fun handleJavaScriptDialog(input: HandleJavaScriptDialogRequest): Single<RequestResponseFrame>
Accepts or dismisses a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload).
interstitialHidden
Link copied to clipboard
fun interstitialHidden(): Flowable<RawEvent>
Fired when interstitial page was hidden
interstitialShown
Link copied to clipboard
fun interstitialShown(): Flowable<RawEvent>
Fired when interstitial page was shown
javascriptDialogClosed
Link copied to clipboard
fun javascriptDialogClosed(): Flowable<JavascriptDialogClosedEvent>
Fired when a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload) has been closed.
javascriptDialogOpening
Link copied to clipboard
fun javascriptDialogOpening(): Flowable<JavascriptDialogOpeningEvent>
Fired when a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload) is about to open.
lifecycleEvent
Link copied to clipboard
fun lifecycleEvent(): Flowable<LifecycleEventEvent>
Fired for top level page lifecycle events such as navigation, load, paint, etc.
loadEventFired
Link copied to clipboard
fun loadEventFired(): Flowable<LoadEventFiredEvent>
Returns observable capturing all Page.loadEventFired events.
name
Link copied to clipboard
fun name(): String
Returns domain name.
navigate
Link copied to clipboard
fun navigate(input: NavigateRequest): Single<NavigateResponse>
Navigates current page to the given URL.
navigatedWithinDocument
Link copied to clipboard
fun navigatedWithinDocument(): Flowable<NavigatedWithinDocumentEvent>
Fired when same-document navigation happens, e.g.
navigateToHistoryEntry
Link copied to clipboard
fun navigateToHistoryEntry(input: NavigateToHistoryEntryRequest): Single<RequestResponseFrame>
Navigates current page to the given history entry.
printToPDF
Link copied to clipboard
fun printToPDF(input: PrintToPDFRequest): Single<PrintToPDFResponse>
Print page as PDF.
produceCompilationCache
Link copied to clipboard
fun produceCompilationCache(input: ProduceCompilationCacheRequest): Single<RequestResponseFrame>
Requests backend to produce compilation cache for the specified scripts.
reload
Link copied to clipboard
fun reload(input: ReloadRequest): Single<RequestResponseFrame>
Reloads given page optionally ignoring the cache.
removeScriptToEvaluateOnLoad
Link copied to clipboard
Deprecated, please use removeScriptToEvaluateOnNewDocument instead.
removeScriptToEvaluateOnNewDocument
Link copied to clipboard
Removes given script from the list.
resetNavigationHistory
Link copied to clipboard
fun resetNavigationHistory(): Single<RequestResponseFrame>
Resets navigation history for the current page.
screencastFrame
Link copied to clipboard
fun screencastFrame(): Flowable<ScreencastFrameEvent>
Compressed image data requested by the startScreencast.
screencastFrameAck
Link copied to clipboard
fun screencastFrameAck(input: ScreencastFrameAckRequest): Single<RequestResponseFrame>
Acknowledges that a screencast frame has been received by the frontend.
screencastVisibilityChanged
Link copied to clipboard
fun screencastVisibilityChanged(): Flowable<ScreencastVisibilityChangedEvent>
Fired when the page with currently enabled screencast was shown or hidden `.
searchInResource
Link copied to clipboard
fun searchInResource(input: SearchInResourceRequest): Single<SearchInResourceResponse>
Searches for given string in resource content.
setAdBlockingEnabled
Link copied to clipboard
fun setAdBlockingEnabled(input: SetAdBlockingEnabledRequest): Single<RequestResponseFrame>
Enable Chrome's experimental ad filter on all sites.
setBypassCSP
Link copied to clipboard
fun setBypassCSP(input: SetBypassCSPRequest): Single<RequestResponseFrame>
Enable page Content Security Policy by-passing.
setDeviceMetricsOverride
Link copied to clipboard
fun setDeviceMetricsOverride(input: SetDeviceMetricsOverrideRequest): Single<RequestResponseFrame>
Overrides the values of device screen dimensions (window.screen.width, window.screen.height, window.innerWidth, window.innerHeight, and "device-width"/"device-height"-related CSS media query results).
setDeviceOrientationOverride
Link copied to clipboard
Overrides the Device Orientation.
setDocumentContent
Link copied to clipboard
fun setDocumentContent(input: SetDocumentContentRequest): Single<RequestResponseFrame>
Sets given markup as the document's HTML.
setDownloadBehavior
Link copied to clipboard
fun setDownloadBehavior(input: SetDownloadBehaviorRequest): Single<RequestResponseFrame>
Set the behavior when downloading a file.
setFontFamilies
Link copied to clipboard
fun setFontFamilies(input: SetFontFamiliesRequest): Single<RequestResponseFrame>
Set generic font families.
setFontSizes
Link copied to clipboard
fun setFontSizes(input: SetFontSizesRequest): Single<RequestResponseFrame>
Set default font sizes.
setGeolocationOverride
Link copied to clipboard
fun setGeolocationOverride(input: SetGeolocationOverrideRequest): Single<RequestResponseFrame>
Overrides the Geolocation Position or Error.
setInterceptFileChooserDialog
Link copied to clipboard
Intercept file chooser requests and transfer control to protocol clients.
setLifecycleEventsEnabled
Link copied to clipboard
Controls whether page will emit lifecycle events.
setProduceCompilationCache
Link copied to clipboard
Forces compilation cache to be generated for every subresource script.
setTouchEmulationEnabled
Link copied to clipboard
fun setTouchEmulationEnabled(input: SetTouchEmulationEnabledRequest): Single<RequestResponseFrame>
Toggles mouse event-based touch event emulation.
setWebLifecycleState
Link copied to clipboard
fun setWebLifecycleState(input: SetWebLifecycleStateRequest): Single<RequestResponseFrame>
Tries to update the web lifecycle state of the page.
startScreencast
Link copied to clipboard
fun startScreencast(input: StartScreencastRequest): Single<RequestResponseFrame>
Starts sending each frame using the screencastFrame event.
stopLoading
Link copied to clipboard
fun stopLoading(): Single<RequestResponseFrame>
Force the page stop all navigations and pending resource fetches.
stopScreencast
Link copied to clipboard
fun stopScreencast(): Single<RequestResponseFrame>
Stops sending each frame in the screencastFrame.
waitForDebugger
Link copied to clipboard
fun waitForDebugger(): Single<RequestResponseFrame>
Pauses page execution.
windowOpen
Link copied to clipboard
fun windowOpen(): Flowable<WindowOpenEvent>
Fired when a new window is going to be opened, via window.open(), link click, form submission, etc.

Sources

jvm source
Link copied to clipboard